﻿<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="struts"%>

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>后台登陆</title>
<link href="css/CSSReset.css" rel="stylesheet"/>
<link href="css/adminLogin.css" rel="stylesheet"/>
	<script>
		function reloadcode(obj){
			var rand = new Date().getTime(); //这里用当前时间作为参数加到url中，是为了使URL发生变化，这样验证码才会动态加载，
			obj.src = "generateValidateCode" + "?abc="+rand; //其实服务器端是没有abc的字段的。
		}
	</script>

</head>
<body class="adminLogin">
    <div id="main">
        <div id="wrapper">
            <form method="post" action="treatLogin">
            <div class="loginBox">
                <label for="userName">用户名:</label>
                <input id="userName" autofocus required name="userName"/><br>
                <label for="password">密&nbsp;&nbsp;码:</label>
                <input id="password" name="password" type="password" required />   <br>
                <label for="role">角&nbsp;&nbsp;色:</label>
                <input name="role" id="role" type="radio"  checked="checked" value="student"/>学生&nbsp;
                <input name="role"  type="radio"  value="teacher"/>教师&nbsp;
                <input name="role"  type="radio"  value="administrator"/>管理员&nbsp;<br>
                <label for="validateCode">验证码:</label>
                <input type="text" required id="validateCode" name="validateCode"/> <img id="safecode" src="./generateValidateCode" title="看不清楚请点击这里" onClick="reloadcode(this)">
                <a href="#">忘记密码?</a>
                <div class="buttonBox">
                    <input id="register" type="button" value="注册" />
                    <input id="login" type="submit" value="登陆" />
                </div>
            </div>
            </form>
        </div>
    </div>
</body>
</html>